package com.rem.listener;

import lombok.Data;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 * @author remembrance
 * @version 1.0
 * @date 2021/11/23 10:08
 */
@WebListener
public class MyListener  implements HttpSessionListener {
    public int number = 0;
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        number++;
        HttpSession session = se.getSession();
        session.setAttribute("number",number);
//        HttpSessionListener.super.sessionCreated(se);
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        HttpSessionListener.super.sessionDestroyed(se);
    }
}
